class GitServer {
  constructor(type, token) {
    this.type = type
    this.token = token
  }
  setToken(token) {
    this.token = token
  }
  createRepo(name) {
    error('createRepo')
  }
  createOrgRepo(name, login) {
    error('createOrgRepo')
  }
  getRemote() {
    error('getRemote')
  }
  getUser() {
    error('getUser')
  }
  getOrg() {
    error('getOrg')
  }
  getRepo(login, name) {
    error('getRepo')
  }
  getTokenHelpUrl() {
    error('getTokenHelpUrl')
  }
  getTokenUrl() {
    error('getTokenUrl')
  }
  isHttpResponse = (response) => {
    return response && response.status;
  };

  handleResponse = (response) => {
    if (this.isHttpResponse(response) && response !== 200) {
      if(response.status === '开始') {
        return response
      }
      return null;
    } else {
      return response;
    }
  };
}
function error(methodName) {
  throw new Error(`${methodName} must be implemented`)
}

module.exports = GitServer